package com.ushio.gougouwangguo.task.config;

import com.ushio.gougouwangguo.entity.mysql.Resource;
import com.ushio.gougouwangguo.mapper.ResourceMapper;

import java.util.List;

public class ResourceUpdateTask implements Runnable {
    private final List<Resource> resources;
    private final ResourceMapper resourceMapper;

    public ResourceUpdateTask(List<Resource> resources, ResourceMapper resourceMapper) {
        this.resources = resources;
        this.resourceMapper = resourceMapper;
    }

    @Override
    public void run() {
        resourceMapper.updateById(resources);
        System.out.println("==================线程触发=======================");
        System.out.println(resources.toString());
    }
}